package com.rcos.droidViz;

import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;

import com.rcos.droidViz.DroidViz;

import android.app.Activity;
import android.content.Context;
import android.opengl.GLSurfaceView;
import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent;
import android.view.WindowManager;

public class DroidVizDemo extends Activity  {
	
	// Our DroidViz Object!
    private DroidViz mDroidViz;
    private DroidVizRenderer mDroidVizRenderer;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		mDroidVizRenderer = new DroidVizRenderer();
		mDroidViz = new DroidViz(getApplication(), mDroidVizRenderer);
		
		// Following 2 Lines Set the Window Flag to Remove Status Bar from the Rendering
		int flags = WindowManager.LayoutParams.FLAG_FULLSCREEN; 
		getWindow().setFlags(flags, flags);
		setContentView(mDroidViz);
	}

    // This method controls what happens when the app pauses
    @Override
    protected void onPause() {
    	super.onPause();
    	mDroidViz.Pause();
    }

    // This method controls what happens when the app resumes
    @Override
    protected void onResume() {
    	super.onResume();
    	mDroidViz.onResume();
    }
    
    @Override
    protected void onStop() {
    	super.onStop();
    	// Removed for this is called on each Resize call by the JAVA level
    	// This causes the contexts to be destroyed yet the JNI wants to call further calls
    	//DroidVizRenderer.DroidVizDone();
 
    }
}